<template>
  <el-card>
    <template #header>
      <h3>商品统计</h3>
    </template>

    <div>
      <!-- 展示图表 -->
      <Charts :CardName="'goods'" @updatePage="SyncRender" />
    </div>
  </el-card>
</template>

<script>
import Charts from '../../components/Charts/Index.vue'
import GoodsOptions from './js/goodsData.js'

export default {
  components: {
    Charts
  },
  data() {
    return {
      GoodsOptions,
      chartObj: {}
    }
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      this.chartObj.setOption(this.GoodsOptions.option)
    },
    SyncRender(obj) {
      // console.log(obj)
      this.chartObj = obj
    }
  }
}
</script>

<style lang="less" scoped></style>
